package kr.co.mcshop.order;

import java.util.List;
import java.util.Map;

import kr.co.mcshop.order.OrderMapper;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component	
public class OrderService {
	@Autowired
	private SqlSession sqlsession;
	
	public List getAllOrder(Map map) {
		OrderMapper mapper = sqlsession.getMapper(OrderMapper.class);
		return mapper.getAllOrder(map);
	}
	public List getUserOrder(Map map) {
		OrderMapper mapper = sqlsession.getMapper(OrderMapper.class);
		return mapper.getUserOrder(map);
	}
	public int InsertOrder(Map map){
		OrderMapper mapper = sqlsession.getMapper(OrderMapper.class);
		return mapper.insertOrder(map);
	}
	
	public int UpdateOrder(Map map){
		OrderMapper mapper = sqlsession.getMapper(OrderMapper.class);
		return mapper.updateOrder(map);
	}
	
	public int deleteOrder(Map map){
		OrderMapper mapper = sqlsession.getMapper(OrderMapper.class);
		return mapper.deleteOrder(map);
	}
}
